package com.wang.interview.designmode.prototype.clone;

/**
 * @author: wang
 * @date: 2021/7/28 21:17
 * @description:
 */
public class CloneTest01String {
    public static void main(String[] args) throws CloneNotSupportedException {
        A a = new A();
        A b = (A)a.clone();
        System.out.println(a == b);  // false
    }
}

class A implements Cloneable{
    private String name;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}

